<template>
  <div class="container">
    <el-form ref="form" :model="form" :rules="rules" label-width="210px">
      <el-form-item label="编码：">
        <div v-text="form.code"></div>
      </el-form-item>
      <el-form-item label="用户标识：">
        <div v-text="form.openid"></div>
      </el-form-item>
      <el-form-item label="平台标识符：">
        <div v-text="form.unionId"></div>
      </el-form-item>
      <el-form-item label="类型：">
        <div>{{ $enum.getMapValue("bindType", form.type).name }}</div>
      </el-form-item>
      <el-form-item label="工号：">
        <div v-text="form.jobNumber"></div>
      </el-form-item>
      <el-form-item label="手机：">
        <div v-text="form.mobile"></div>
      </el-form-item>
      <el-form-item label="备注：">
        <div v-text="form.remark"></div>
      </el-form-item>
      <el-form-item label="创建时间：">
        <div v-text="form.createdTime"></div>
      </el-form-item>
      <el-form-item label="更新时间：">
        <div v-text="form.modifiedTime"></div>
      </el-form-item>

      <el-form-item>
        <el-button size="small" @click="goBack">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>

import {thirdBindGrantDetailApi} from "../../../api/mgt/system/thirdBindGrant";
import {deepCopy} from "@/utils";

const obj = {
  //信息
  openid: "",
  unionid: "",
  bindKey: "",
  type: "",
  jobNumber: "",
  mobile: "",
  realName: "",
  remark: ""
};

export default {
  data() {
    return {
      form: deepCopy(obj),
    };
  },
  methods: {
    // 编辑操作
    getDetail(id) {
      thirdBindGrantDetailApi({id}).then((res) => {
        this.form = res?.bizData;
      });
    },
    goBack() {
      this.$router.goPage({
        path: "/thirdBindGrant/page",
      });
    },
  },
  created() {
    const {id} = this.$route.query;
    this.getDetail(id);
  },
};
</script>
